
package code.codeworld.space.blog.model;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * blog实体
 *
 * @author freecode
 * @date 2023/03/23 00:20
 **/
@Getter
@Setter
@Entity
@TableName("blog")
public class Blog {
    //implements Serializable  implements Cloneable

    /*//深拷贝
    @Override
    protected Object clone() throws CloneNotSupportedException {
        blog c = null;
        c = (blog) super.clone();
        return c;
    }*/

    /*@Serial
    private static final long serialVersionUID = 1L;*/

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    //@NotNull(message = "ID不可为空")
    private Integer id;

    /**
     * 类型 Y
     */
    private String type;

    /**
     * 子类型
     */
    private String subtype;

    /**
     * 标题 Y
     */
    private String title;

    /**
     * 来源
     */
    @Column(name = "`FROM`")
    @TableField("`FROM`")
    private String from;

    /**
     * 作者 Y
     */
    private String author;

    /**
     * 图片 以 / 符合分割保存 images
     */
    private String images;

    /**
     * 简介
     */
    private String blurb;

    /**
     * 类容 Y
     */
    private String content;

    /**
     * 拓展信息
     */
    private String extend;

    /**
     * 备注
     */
    private String remark;

    /**
     * 评论
     */
    @Column(name = "`comment`")
    private String comment;

    /**
     * 字数 Y
     */
    private Integer wordage;

    /**
     * 星数
     */
    @Column(name = "star_num", length = 100)
    private Integer starNum;

    /**
     * 收藏数
     */
    @Column(name = "collect_num", length = 100)
    private Integer collectNum;

    /**
     * 状态：0草稿 1审核 2驳回 3发布
     */
    private Integer states;

    /**
     * 审核结论
     */
    private String verdict;

    /**
     * 删除标志
     */
    @Column(name = "delete_flag", length = 2)
    private Integer deleteFlag;

    /**
     * 创建IP
     */
    @Column(name = "create_ip")
    private String createIp;

    /**
     * 创建时间
     */
    //@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 创建用户
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 修改IP
     */
    @Column(name = "update_ip")
    private String updateIp;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 修改用户
     */
    @Column(name = "update_user")
    private String updateUser;

    //分页序号
    @Transient
    private Integer autoNum;

    //总页数
    @Transient
    private Integer pageTotal;


}
